package com.zxl.gtion.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: bo-feifei
 * @Date 2024/3/8 10:11
 * @Version 1.0
 */
@Getter
public enum CatalogEnums {

    DISEASE("0","疾病知识"),
    JOURNALISM("1","新闻"),
    POLICY("2","政策"),
    FIRST_VACCINE("3","一级疫苗", "https://bofeifei.oss-cn-beijing.aliyuncs.com/vaccine/9b093129-8230-4e7e-9e3e-74412084b86c.png"),
    SECOND_VACCINE("4","二级疫苗","https://bofeifei.oss-cn-beijing.aliyuncs.com/vaccine/86a4fac4-9fb2-4abc-8563-18d4151aaa29.png"),
    PASSIVITY_VACCINE("5","被动免疫制剂","https://bofeifei.oss-cn-beijing.aliyuncs.com/vaccine/76c74b2b-9e60-4ded-9712-e2e30ce84595.png"),
    ;

    private final String value;
    private final String desc;
    private String img;

    CatalogEnums(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    CatalogEnums(String value, String desc, String img) {
        this.value = value;
        this.desc = desc;
        this.img = img;
    }

    public static List<String> getVaccines() {
        List<String> vaccinesType = new ArrayList<>();
        vaccinesType.add(FIRST_VACCINE.getValue());
        vaccinesType.add(SECOND_VACCINE.getValue());
        vaccinesType.add(PASSIVITY_VACCINE.getValue());
        return vaccinesType;
    }

    public static List<String> getNotVaccines() {
        List<String> vaccinesType = new ArrayList<>();
        vaccinesType.add(DISEASE.getValue());
        vaccinesType.add(JOURNALISM.getValue());
        vaccinesType.add(POLICY.getValue());
        return vaccinesType;
    }

    public static String getDescByValue(String value) {
        for (CatalogEnums orderStatusEnums : values()) {
            if (orderStatusEnums.getValue().equals(value)) {
                return orderStatusEnums.getDesc();
            }
        }
        return null;
    }

    public static String getImgByValue(String value) {
        for (CatalogEnums orderStatusEnums : values()) {
            if (orderStatusEnums.getValue().equals(value)) {
                return orderStatusEnums.getImg();
            }
        }
        return null;
    }
}
